package com.rogereis.sisvendas.view;

import java.util.Date;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;

import br.gov.frameworkdemoiselle.stereotype.ViewController;
import br.gov.frameworkdemoiselle.template.AbstractEditPageBean;
import br.gov.frameworkdemoiselle.transaction.Transactional;

import com.rogereis.sisvendas.business.ClienteBC;
import com.rogereis.sisvendas.domain.Cliente;

@ViewController
@RequestScoped
public class ClienteEditMB extends AbstractEditPageBean<Cliente, Integer>{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Inject
	private ClienteBC clienteBC;
	
	private Cliente clienteSelecionado = new Cliente();
	
	@Override
	@Transactional
	public String insert() {
		clienteSelecionado.setDataCadastro(new Date());
		clienteBC.insert(clienteSelecionado);
		return null;
	}

	public Cliente getClienteSelecionado() {
		return clienteSelecionado;
	}

	public void setClienteSelecionado(Cliente clienteSelecionado) {
		this.clienteSelecionado = clienteSelecionado;
	}

	@Override
	public String delete() {
		// TODO Auto-generated method stub
		return null;
	}

	

	@Override
	public String update() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected void handleLoad() {
		// TODO Auto-generated method stub
		
	}

}
